package com.zjq.smartdevice.mapper;

import com.zjq.smartdevice.pojo.SysCategory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @User zhangjiaqi
 * @Project project
 * @Package com.zjq.smartdevice.mapper
 * @Date 2022/3/18 19:37
 */
public interface SysCategoryMapper {

    @Insert("insert into sys_category((category_name,tx_command,rx_command,command_name,create_by,create_time)"+
            "values (#{categoryName},#{txCommand},#{rxCommand},#{commandName},#{createBy},#{createTime}))")
    void addSysCategory(SysCategory sysCategory);

    @Select("select * from sys_category where c_id=#{id}")
    SysCategory findById(Long id);

    @Select("select * from sys_category")
    List<SysCategory> findAll();

    int updateCategory(SysCategory category);

    int deleteByIds(@Param("ids") List<Long> ids);

}
